package com.lanou.managerLogin.order.web.servlet;

import com.lanou.managerLogin.order.service.OrderService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/deliverGoodsServlet")
public class DeliverGoodsServlet extends HttpServlet {

    private OrderService os = new OrderService();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //修改订单状态
        //2->3发货
        String oid = req.getParameter("oid");
        int state = Integer.parseInt(req.getParameter("state"));
        os.updateOrder(oid,state);
        req.getRequestDispatcher("/orderListServlet").forward(req,resp);
    }
}
